home *** CD-ROM | disk | FTP | other *** search
- >> It sort of sounds like you're agreeing with me, that the FD_CLOSE is
- >> unnecessary after the closesocket. I think the statement that closesocket
- >> cancels async notifications takes precedence, and if an app really needs
- >> to find out if the connection closed gracefully, it should hang onto the
- >> descriptor, use shutdown(1) to send a FIN, then read to EOF.
-
- This seems reasonable and correct to me.
-
- --
- Brad Wilson Share and Enjoy! Voice: (800)282-4FTP Fax: (508)659-6297
- Not speaking for FTP Software, Inc. Internet: wilson@ftp.com msg++;
- "i am the bullet in the gun / i am the truth from which you run
- i am the silencing machine / i am the end of all your dreams" - NIN
- From rcq@mailserv-D.ftp.com Wed May 4 13:53:43 1994
- Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
- id AA23846; Wed, 4 May 1994 17:55:02 -0400
- Received: from ftp.com by ftp.com ; Wed, 4 May 1994 17:54:58 -0400
- Received: from mailserv-D.ftp.com by ftp.com ; Wed, 4 May 1994 17:54:58 -0400
- Received: from rcq.sidearm.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
- id AA23621; Wed, 4 May 94 17:53:43 EDT
- Date: Wed, 4 May 94 17:53:43 EDT
- Message-Id: <9405042153.AA23621@mailserv-D.ftp.com>
- To: Bruce@isi.FrontierTech.COM
- Subject: Re: FD_CLOSE after closesocket (was: Curious behaviour from winsock)
- From: rcq@ftp.com (Bob Quinn)
- Reply-To: rcq@ftp.com
- Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
- Sender: rcq@mailserv-D.ftp.com
- Repository: mailserv-D.ftp.com, [message accepted at Wed May 4 17:53:29 1994]
- Originating-Client: sidearm.ftp.com
- Content-Length: 2927
-
- > It sort of sounds like you're agreeing with me, that the FD_CLOSE is
- > unnecessary after the closesocket. I think the statement that closesocket
- > cancels async notifications takes precedence,
-
- So we're faced then with either having the spec say that:
- - FD_CLOSE doesn't occur *at all* on a socket that initiates the close
- (with shutdown() or with closesocket()), since in effect it just
- tells you something you already know.
- OR
- - FD_CLOSE does *not* occur after calling closesocket() to initiate the
- close of a TCP connection, but it *does* occur after calling shutdown()
-
- That's about as transparent as my cafe latte.
-
- > and if an app really needs
- > to find out if the connection closed gracefully, it should hang onto the
- > descriptor, use shutdown(1) to send a FIN, then read to EOF.
-
- I couldn't agree with this more. The problem is that most people
- don't know this method, as evidenced by most WinSock applications
- around these days.
-
- > IMHO,
- > calling closesocket says "I am done with this socket, and have no further
- > interest in anything associated with it."
-
- I agree, but I don't want to.
-
- As is, the specification says this, yes. IMNSHO, you *should*
- be able to post a message (FD_CLOSE only, not FD_READ or others)
- for a socket that has been closed by closesocket(). As we all
- know, every application is *required* to expect receipt of messages
- on a socket even after the socket has been closed. This is because
- of the latency between the posting and receipt of messages. In
- other words, there is always the chance of as yet unprocessed
- messages in your queue when you call closesocket().
-
- So what? So, I (still) think that FD_CLOSE is broken if it doesn't
- tell you when you reach TIME_WAIT instead of CLOSE_WAIT. WinSock
- should indeed tell you when the close is complete. Not just cuz
- I like the warm and fuzzy feeling I get knowing a connection closed
- gracefully, but also because it's easy to write an application that
- works with this and it satisfies my insatiable desire for a logical
- and symmetrical world (which is--amazingly enough--possible in the
- computer software realm).
-
- > I still maintain that closesocket invalidates the descriptor and what
- > would an app do if it didn't get the FD_CLOSE it expected? Reset the
- > connection? It can't, because it has no reference to the connection now
- > that the socket descriptor is gone. It might display a warning to the
- > user, but since it can't take any meaningful steps to correct the problem,
- > this would amount to "I've fallen, and I can't get up!"
-
- As much as I like that error message, I think it might be more
- meaningful to a user to say something like "the connection on
- the remote host was disconnected unexpectedly".
-
- Regards,
- --
- Bob Quinn rcq@ftp.com
- FTP Software, Inc. No. Andover, MA
-
-